UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vzY6zPxI3/exVNPDZZQG+jzewWVSLmrUV8xIEBrqsOA=' 
WHERE 
  key_id = 'dac2e0cbf7c3fc66ed062b205c1f9c4ce5c5e72a75ac32684323f19a44209635' 
  AND (
    token = 'vzY6zPxI3/exVNPDZZQG+jzewWVSLmrUV8xIEBrqsOA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025