UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lWtimzx39d1yxxb/uOhIf/SGBScXMRIA0VvGUUckSzE='
WHERE
key_id = '87ffba3fb36571dc0f3fe62cc1825d46f64b280319f11e377b33b036773517a5'
AND (
token = 'lWtimzx39d1yxxb/uOhIf/SGBScXMRIA0VvGUUckSzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)