UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nLTXVgyZN70G7B0UKQ/DJOjpBv76AeocFpnhtXLTZRE=' 
WHERE 
  key_id = '1597f94e9aff9b1875082f483cc14a4cb7c43a0bdaac64b4042adc52a917b158' 
  AND (
    token = 'nLTXVgyZN70G7B0UKQ/DJOjpBv76AeocFpnhtXLTZRE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044