UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bo9Iq6x2JibFKS9ksXkl+Ztgf0kGAx5yeLZsJHAWDc0='
WHERE
key_id = 'e517eb2bd0c4c7e0338bc3809a4f3ddfc92b8230cf7d09ba826c5deb37cf9eba'
AND (
token = 'bo9Iq6x2JibFKS9ksXkl+Ztgf0kGAx5yeLZsJHAWDc0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)