UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kMf2pBQyGyYL5Am2bJxa1xSjvbyGRT7KzlQIQCGvAlA=' 
WHERE 
  key_id = '144b0850c63f9c4433aaf8535ba1c142aff9abbadf419f45307945c8e0657ffd' 
  AND (
    token = 'kMf2pBQyGyYL5Am2bJxa1xSjvbyGRT7KzlQIQCGvAlA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016