UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5z4NIrL3B9YmiILwFqOBG0wAd46IM8C3C8irwbZJbcg=' 
WHERE 
  key_id = '35a6d10ff304bc3ed58880327d176ac1b0320a4e601ea7b81d14816e698e8a7b' 
  AND (
    token = '5z4NIrL3B9YmiILwFqOBG0wAd46IM8C3C8irwbZJbcg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049