UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9WS3+z0OabyPCxap4X1iG09G6ROxuIcOICMDzPBJ2FI='
WHERE
key_id = '2a308fc9a286e763b93bcc0ccba67ac5962b7323df97666dc098e29fb09a9bac'
AND (
token = '9WS3+z0OabyPCxap4X1iG09G6ROxuIcOICMDzPBJ2FI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)