UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bDlqmuleCRpQLx6TWnDQzry5o4FIfSbdDNbDw+HMGhk='
WHERE
key_id = '86536e6940b4c24dd92fdd1fd5bb40782ede6856b9fd817a9eedc1ab7b0f4620'
AND (
token = 'bDlqmuleCRpQLx6TWnDQzry5o4FIfSbdDNbDw+HMGhk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)