UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0jKEvYSp9+C++uURu1UZvkGPpIhpdbY1YVqeaCTD7d4='
WHERE
key_id = 'a6568439acb114d28ea3360c2cc076c47a3c0ab606d4400b81c8faccb5d04928'
AND (
token = '0jKEvYSp9+C++uURu1UZvkGPpIhpdbY1YVqeaCTD7d4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)