UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H5IdLfNtCOGStr4VPV5N7L/87Ax+c0RaLANNLNRFXXg='
WHERE
key_id = '2ad76ec8de810c6209f18943cf1c29ed894a7e73c4b39d4bb233eecbc42d11d9'
AND (
token = 'H5IdLfNtCOGStr4VPV5N7L/87Ax+c0RaLANNLNRFXXg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)