UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CmdonbkYa19QIhy0GdBwTRCZDXgyTvxsm96H1UaUTOo=' 
WHERE 
  key_id = 'e75488eee1804acc8aa26ad53c4d1a86d82759fd6dfa9b8d59a98384a4132bf0' 
  AND (
    token = 'CmdonbkYa19QIhy0GdBwTRCZDXgyTvxsm96H1UaUTOo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023