UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZbxFDkyjuPxLk8scQJXwc5+G//L8S+R1N36GULgJA9U=' 
WHERE 
  key_id = 'ee1537fb245143432668a9e49b229e525f90200f5263762f63779120f7741643' 
  AND (
    token = 'ZbxFDkyjuPxLk8scQJXwc5+G//L8S+R1N36GULgJA9U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051