UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rZFgIFymA9mGyVGX+CiEakDF7ZtLslyTQlqS/oHR21Q=' 
WHERE 
  key_id = 'c98d3a40016895bfc97e5d79a0c9a0c979160e836d88afe3f921de6e3efb8b4d' 
  AND (
    token = 'rZFgIFymA9mGyVGX+CiEakDF7ZtLslyTQlqS/oHR21Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018