UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IysbRx4eaj65AkZGtKwU4hQfEEivFtf1lyN4pU0XHa0='
WHERE
key_id = 'fe5eb121fbdad11af8c3eafa5fee56f32826321a2ca1c54060cfa656e254887d'
AND (
token = 'IysbRx4eaj65AkZGtKwU4hQfEEivFtf1lyN4pU0XHa0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)