UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z8LPVIgmFJ4m0z5fFGVJrkosPTBi1unCAw9uprlZGVc='
WHERE
key_id = 'bfe0803df3ea644699ce3e35dd39c5685cfeca918999dbb12eb9778bfbf68613'
AND (
token = 'z8LPVIgmFJ4m0z5fFGVJrkosPTBi1unCAw9uprlZGVc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)