UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KVmVMm/1wEakUD85qK+2SkK1/EzGoHjmnSFf2yGY/Pk=' 
WHERE 
  key_id = '17e319a039b18b42a2fa3edcca8f56d22278d588dacf1e15eff1aecafb4623fa' 
  AND (
    token = 'KVmVMm/1wEakUD85qK+2SkK1/EzGoHjmnSFf2yGY/Pk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017