UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/zpMhycTKs8xNyuufp0B8phb/rlAvUGyiFdhIgiSAH4='
WHERE
key_id = '3d9241d04268416788f47b7959ec4563954ec22dc8c83381287b821f4152c334'
AND (
token = '/zpMhycTKs8xNyuufp0B8phb/rlAvUGyiFdhIgiSAH4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)