UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9JFMmgpo2L04ssyHe9M+OkLCZ6pIRyPjPeUlNCSNbrg='
WHERE
key_id = 'a65813db531840eb46ae4028216d84927d7ed4c563b106af528edb3a0cc17553'
AND (
token = '9JFMmgpo2L04ssyHe9M+OkLCZ6pIRyPjPeUlNCSNbrg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)