UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hsft6B0CgV2ppp7/AfA24eZJJWXkY5fPRMrMyA5sSMI=' 
WHERE 
  key_id = '6e2f817d05c2456654fe8272e7723905a8eef49da6e8036e2b7ebdce84ba1bde' 
  AND (
    token = 'hsft6B0CgV2ppp7/AfA24eZJJWXkY5fPRMrMyA5sSMI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036