UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FtFjwjbL7tw4N6D/fChb/k4mO8VtYHbYhlOAVJj3mvY='
WHERE
key_id = '3e34a5252bef8fdd84bdf5a39209849e082b9469e48eed105fc7f76b3c6604c9'
AND (
token = 'FtFjwjbL7tw4N6D/fChb/k4mO8VtYHbYhlOAVJj3mvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)