UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UeS0pAXkxvU4i+y8Pn4ayfFk7GR+hqpamgpE3tff/JU=' 
WHERE 
  key_id = '30421617cb90fcff1bb06ddbcf45f80617fcd4591539b7ee513ebb3b0e4900ce' 
  AND (
    token = 'UeS0pAXkxvU4i+y8Pn4ayfFk7GR+hqpamgpE3tff/JU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034