UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1j3LtcZhV7+sYXLLO8vUj3na8HHREMmEFoDmj/dJFpo=' 
WHERE 
  key_id = 'de6bf60f56ed581151d4a34979861bab1b5fc5b5b09f146837175e187d63ffdf' 
  AND (
    token = '1j3LtcZhV7+sYXLLO8vUj3na8HHREMmEFoDmj/dJFpo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024