UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NP7onQB/8Nf5HcidkDYKZDWZa38V3Ldw/ATvTHDts30=' 
WHERE 
  key_id = 'c63bd946f8bd577af8f19370b9d7d86b7f7ffde28378ad8fa565a6520f1054fd' 
  AND (
    token = 'NP7onQB/8Nf5HcidkDYKZDWZa38V3Ldw/ATvTHDts30=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025