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

Query time 0.00044