UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3+n5rAxCYGZAr2LnW0iTy3o1/sMMGaEzDTr9GsBz7fk='
WHERE
key_id = '7cd74d6d2f6a45cff9a1b2ce241c5b93978980b234b07da1b4a7f5ed8bdd7048'
AND (
token = '3+n5rAxCYGZAr2LnW0iTy3o1/sMMGaEzDTr9GsBz7fk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)