UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kcevd3R4oh+lDv+RHSWZS6bvbSA1vkCvhz3WBkBv/p4=' 
WHERE 
  key_id = 'b9bc3f51a872c4d500e709b313d0126700d7899162611c056f7c19cc98fc7df5' 
  AND (
    token = 'kcevd3R4oh+lDv+RHSWZS6bvbSA1vkCvhz3WBkBv/p4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062