UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IJkN01Jqo99zSm0G9ARKwrFwsRh0Mk3FmdQuyA8ZqJw=' 
WHERE 
  key_id = '23fe8f90487c8080b519a1cc56a1a9c23dfcb753261a9301ce0210a3e021072e' 
  AND (
    token = 'IJkN01Jqo99zSm0G9ARKwrFwsRh0Mk3FmdQuyA8ZqJw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041