UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wNB2fPW9Md2LhzeZBiHKdkCzomJcL/17J9PUh26YwCA=' 
WHERE 
  key_id = '83e57a82bba3bd8cb63a185bb24c2c9cd1d4cbae2d8c62a85bea62a63320b837' 
  AND (
    token = 'wNB2fPW9Md2LhzeZBiHKdkCzomJcL/17J9PUh26YwCA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018