UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w5hNIxnVXL9H47Dk+rfuwtjX5RptSlmyOrYLRazQL9E=' 
WHERE 
  key_id = '17b75a8fa2729dd852928a52c1556d022df3848f805bea5a0123b1abf271466d' 
  AND (
    token = 'w5hNIxnVXL9H47Dk+rfuwtjX5RptSlmyOrYLRazQL9E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021