UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VJABQ6+9yQ69aFkRG8q1y4/Y0r3JohuXAMtIE0zbI+g=' 
WHERE 
  key_id = 'acc8db6792427db509a3c1ebf4ba9a1a9d7ef92cb841161fcae61fe44d678065' 
  AND (
    token = 'VJABQ6+9yQ69aFkRG8q1y4/Y0r3JohuXAMtIE0zbI+g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039