UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2Ut+FR/tsasUtxWD6WnYacjVpvhqgnutni8dSX5eOPI=' 
WHERE 
  key_id = 'b555c27d9a9cc532f48ec45c0b384f7616d91198fca8b07f3dc552f8c0a7ab27' 
  AND (
    token = '2Ut+FR/tsasUtxWD6WnYacjVpvhqgnutni8dSX5eOPI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017