UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nlrjm0RhwAc1M6ahMJWp0mphrBW1Ov2EV68rM08Wcb8=' 
WHERE 
  key_id = 'f1065f371a25746fa53c3f4cbb6d9257b68da6c88e45dcca85ac06993ecb1f55' 
  AND (
    token = 'nlrjm0RhwAc1M6ahMJWp0mphrBW1Ov2EV68rM08Wcb8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043