UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JDZo+JwFD2tknJ2lr2fnGG9BFqQ3vedmuZ7mPVK/PJ0='
WHERE
key_id = '1bb8995b39dee09f7bf6638fd9f26d62a42090106afbbaf33201f23b304b2df8'
AND (
token = 'JDZo+JwFD2tknJ2lr2fnGG9BFqQ3vedmuZ7mPVK/PJ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)