UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Blv8289xV2tWQK/x9/0n4Qbo6F33d0OjdvPO+gOlH4E='
WHERE
key_id = 'dc3240b2feea8820f9da5a27e0dc87bba1a5bc7ab1cc1999b3535528440aad64'
AND (
token = 'Blv8289xV2tWQK/x9/0n4Qbo6F33d0OjdvPO+gOlH4E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)