UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3F2QYnnxAHs/fdS5eLVlQ1dAcyw0iklaeNww7Ur/GNY=' 
WHERE 
  key_id = 'e242395749d45a35c26a4a4bdccbfcbf9fab0068914cea148a524c9e686ed128' 
  AND (
    token = '3F2QYnnxAHs/fdS5eLVlQ1dAcyw0iklaeNww7Ur/GNY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023