UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pElF6dRWWZ2jRGNgNcXPz+LUfUQgmjmQ5lndnhbI8hU='
WHERE
key_id = '54a30978b9489bc82a94ad0371beb38e8c4fe20273b2c7c9277e36c68106f420'
AND (
token = 'pElF6dRWWZ2jRGNgNcXPz+LUfUQgmjmQ5lndnhbI8hU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)