UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tHmA6ISeGW8TCJDZ/2ZGBr2QVRxs5HcFQX15Wfm7an0=' 
WHERE 
  key_id = '65a79aefe365439325e321b5759840888195236f69ae821fcbd322560f255d53' 
  AND (
    token = 'tHmA6ISeGW8TCJDZ/2ZGBr2QVRxs5HcFQX15Wfm7an0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031