UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pjCjbVJNFVpU6s8CjNyJkE22d1EwRawnNdT84v7wT9o='
WHERE
key_id = '90eccb70b7f249e80c340f1285a39a1bd7c37a7c0c22f7155fe1419d4c65221a'
AND (
token = 'pjCjbVJNFVpU6s8CjNyJkE22d1EwRawnNdT84v7wT9o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)