UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nsS/e/0Rk4/UV4LPKbwsY5bNBJXg/XX5D0Wmrw2zGUk=' 
WHERE 
  key_id = '08031dbddcc169d4145dbd128ec6fdf3a11fff54d00db485d9a16a5d52c47907' 
  AND (
    token = 'nsS/e/0Rk4/UV4LPKbwsY5bNBJXg/XX5D0Wmrw2zGUk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030