UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nho0w6DcgJuhFDa42aoViAeKrhpUmVTzRLeNkx5LQiE='
WHERE
key_id = '8f55734737eeb99e03e2f560b77bd4ac54bb91600e8b9195967751d42545628f'
AND (
token = 'nho0w6DcgJuhFDa42aoViAeKrhpUmVTzRLeNkx5LQiE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)