UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6mGkPmeyF7PZ0k3yFmG7TlzhAysLO5vdkmQqfIB/J+c=' 
WHERE 
  key_id = '62877cf8e9b38dd739c2d16edd51921e4e34eb54f612b1b4dda3fd0987f96782' 
  AND (
    token = '6mGkPmeyF7PZ0k3yFmG7TlzhAysLO5vdkmQqfIB/J+c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027