UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6i9Xs1q/YVUbwbyt6ZMYvYnOQL6E9hNpSHV30tXbkIQ=' 
WHERE 
  key_id = 'b98ebadd92f218a15ec8c3d62f31a9d216eb020cc437b2aa26646bbb3f813eb9' 
  AND (
    token = '6i9Xs1q/YVUbwbyt6ZMYvYnOQL6E9hNpSHV30tXbkIQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066