UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b+V0yuZe0pCgrXttWdzBKP/0Ze8US4cyIrl50gWwp8Y='
WHERE
key_id = '5b2982e6a5aa565b292722c738e22aa0d115f41d50cb2af25010c4e5b3389a4e'
AND (
token = 'b+V0yuZe0pCgrXttWdzBKP/0Ze8US4cyIrl50gWwp8Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)