UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zbiGFNCbeTHcJ5kCl4rSQ5rHm2kjQpwLEZoBgmnA/D4=' 
WHERE 
  key_id = 'dfccfd131bd166930eff59c0e02c576338e0a9b9a8cf388f14e458fd6e9f408f' 
  AND (
    token = 'zbiGFNCbeTHcJ5kCl4rSQ5rHm2kjQpwLEZoBgmnA/D4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053