UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ezy9Zk6ylJ0VXel++f5JoO+AoXtcR+OISlZrpfktQHI=' 
WHERE 
  key_id = '7f3359f5d4e5b540082ceaafdfcbe8235d754077ec46d62ece1a41a62a2cee5e' 
  AND (
    token = 'Ezy9Zk6ylJ0VXel++f5JoO+AoXtcR+OISlZrpfktQHI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034